package com.mogu_soup.util;

import java.applet.Applet;
import java.applet.AudioClip;
import java.io.File;
import java.net.MalformedURLException;

/**
 * Version: 2.1
 * Author: TangJun
 * Date: 2024-08-04
 * Note: 播放开场音乐
 */
public class MyMusic {
    private static AudioClip music;
    static {
        try {
            music = Applet.newAudioClip(new File("resource\\music\\music.wav").toURL());
        } catch (MalformedURLException e) {
            throw new RuntimeException(e);
        }
    }

    public static void PlayMusic() {
        music.play();
    }
}
